package com.qiwenshare.file.config.sso;

import com.baomidou.kisso.web.interceptor.SSOSpringInterceptor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * 描述:针对输卵管做的登录拦截
 * @param
 * @return
 **/
@ControllerAdvice
@Configuration
public class SsoConfig extends WebMvcConfigurationSupport {

    @Value("${kisso.config.enable}")
    private Boolean isEnable;

    @Override
    public void addInterceptors(InterceptorRegistry registry){
        if(isEnable)
            registry.addInterceptor(new SSOSpringInterceptor()).addPathPatterns("/file/queryfilelist","/file/query");
    }
}
